from db.mysql import mysql

async def get_industry_tree():
    query = """
        SELECT 
            l1.id AS table1_id, 
            l1.name AS table1_name,
            l2.id AS table2_id, 
            l2.name AS table2_name, 
            l2.description AS info
        FROM industry_l1 l1
        LEFT JOIN industry_l2 l2 
            ON l1.id = l2.l1_id
        ORDER BY l1.id, l2.id;
    """
    result = await mysql.fetch_all_ori(query)
    return result

"""
async def get_l2info_by_l1id(l1_id: str):
    query = "SELECT * FROM agent WHERE userId = %s"
    return await mysql.fetch_one(query, (userId,))""
"""